home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / customers / customer-list.jsp < prev    next >
Encoding:
Text File  |  2003-04-29  |  5.5 KB  |  172 lines

  1. <%@ page language="java" import="
  2.     java.util.*,
  3.     com.jproxy.site.ejbeans.interfaces.*,
  4.     com.jproxy.site.*"
  5. %>
  6. <jsp:useBean id="ses" scope="session" class="com.jproxy.site.JSPSession"/>
  7. <%
  8. if (!ses.isLoggedIn()) {
  9. %>
  10.   <jsp:forward page="login.jsp">
  11.   </jsp:forward>
  12. <%
  13. }
  14. ses.request(pageContext);
  15. ses.setNewHit(pageContext, "hits", "Customers List", null);
  16. %>
  17.  
  18. <%
  19. ICustomer account = ses.getLogin();
  20. String customerName = account.getCustomerName();
  21. String customerID = account.getID();
  22. int totalLicenses = 0;
  23. int totalPurchasedLicenses = 0;
  24. String bgcolors[] = {"#F3F8FF", "#FFFFFF"};
  25.  
  26. Vector customers = ses.session.getCustomers(customerID);
  27. %>
  28.  
  29. <!-- HEADER -->
  30. <jsp:include page="header.jsp" flush="true">
  31.   <jsp:param name="pageId" value="customer_list"/>
  32. </jsp:include>
  33.  
  34. <!-- MAIN PANEL -->
  35. <br>
  36. <table class="h8Verdana" cellpadding="5" width="100%" border="0">
  37. <!-- Prolog -->
  38.   <tr>
  39.     <td>
  40.       <span class="h9VerdanaBold"><%=customerName%></span>, welcome to OEM Partner Managing Console!
  41.       <p>
  42.       <%
  43.       if (customers.size() == 0)
  44.       {
  45.       %>
  46.          In order to start purchasing licenses you need to create a customer
  47.          entry for which you would like to purchase those licenses for.
  48.          <p>
  49.          To create a new Customer please click
  50.          <a class="h8VerdanaBold" href="<%=JSPRes.path%>/main/customers/customer-edit.jsp?key=new" alt="Creates a new customer">here</a>
  51.          or use a navigation bar in the left side of the window.
  52.          <p>
  53.       <%
  54.       }
  55.       else
  56.       {
  57.       %>
  58.         <table class="h8Verdana" border="0" cellpadding="2" cellspacing="2" width="100%">
  59.          <tr class="h8VerdanaBold" bgcolor="9c9cff">
  60. <!--
  61.            <td>
  62.              <INPUT name="delete_customer" type="submit" value="Delete">
  63.            </td>
  64. -->
  65.            <td width="30%">Customer Name</td>
  66.            <td width="50%">Customer Details</td>
  67.            <td width="10%">Purchased<br>licenses</td>
  68.            <td width="10%">Action</td>
  69.          </tr>
  70.  
  71.          <%
  72.           for(int i=0; i<customers.size(); i++)
  73.           {
  74.                 ICustomer customer = (ICustomer)customers.elementAt(i);
  75.                 String _customerID = customer.getID();
  76.                 Vector purchases = ses.session.findPurchases(_customerID, "");
  77.                 int purchasedLicenses = 0;
  78.                 for(int j=0; j<purchases.size(); j++)
  79.                 {
  80.                     IPurchase purchase = (IPurchase)purchases.elementAt(j);
  81.                     int licenses = purchase.getNumberOfLicenses();
  82.                     purchasedLicenses += licenses;
  83.                     totalPurchasedLicenses += licenses;
  84.                 }
  85.           %>
  86.  
  87.       <!-- Customer 1 Begin -->
  88.                <tr bgcolor="<%=bgcolors[i % 2]%>">
  89. <!--
  90.                  <td align="center">
  91.                   <INPUT name="selected" type="checkbox">
  92.                  </td>
  93. -->
  94.                  <td align="left">
  95.             <%
  96.             if(purchasedLicenses==0)
  97.             {
  98.             %>
  99.                   <a href="<%=JSPRes.path%>/main/customers/customer-edit.jsp?key=edit&customer-id=<%=_customerID%>&forward=customer-list.jsp"><%=customer.getCustomerName()%></a>
  100.             <%
  101.             }
  102.             else
  103.             {
  104.             %>
  105.                   <%=customer.getCustomerName()%>
  106.             <%
  107.             }
  108.             %>
  109.                  </td>
  110.                  <td align="left">
  111.                   <%
  112.                    if (customer.getDetails().length() == 0)
  113.                   %>
  114.                     None
  115.                   <%
  116.                    else
  117.                   %>
  118.                     <%=customer.getDetails()%>
  119.                  </td>
  120.                  <td align="left">
  121.                   <%=purchasedLicenses%>
  122.                  </td>
  123.                  <td align="left" valign="center">
  124.                    <a class="h8Verdana" href="<%=JSPRes.path%>/main/customers/product-list.jsp?customer-id=<%=_customerID%>"> [Products] </a>
  125.                  </td>
  126.                </tr>
  127.          <%
  128.           }
  129.          %>
  130.         <!-- Customer N End -->
  131.         </table>
  132.         <p>
  133.  
  134.         <table class="h8Verdana" width="100%" border="0" bgcolor="#f3f8ff" cellpadding="1" cellspacing="0">
  135.         <tr>
  136.           <td>
  137.            <span class="h8Verdana">
  138.             You've a total of <span class="h8VerdanaBold"><%=customers.size()%></span>
  139.             customers with total purchase of <span class="h8VerdanaBold"><%=totalPurchasedLicenses%></span>
  140.             licenses
  141.            </span>
  142.          </td>
  143.         </tr>
  144.         </table>
  145.  
  146.         <p>
  147.          For technical support please follow <i>[Products]</i> link.
  148.          Note, that your support contract must still be valid.
  149.          <p>
  150. <!--
  151.          If you think that you've found a bug please submit your findings to
  152.          <a class="h8VerdanaBold" href="mailto:<%=JSPRes.techSupport%>?subject=Bug Report&body=My Partner ID:
  153. {Your ePortal Login name}%0d%0a
  154. Product name and version: JProxy Tunnel {your version}%0d%0a
  155. JVM provider and version:%0d%0a
  156. Browser name and version:%0d%0a
  157. AppServer name and version:%0d%0a
  158. Apache/Tomcat/{ServlerEngine} version:%0d%0a
  159. Problem description:%0d%0a
  160. Stack trace:%0d%0a">this email</a>.
  161. -->
  162. <%
  163. }
  164. %>
  165. </td>
  166. </tr>
  167. <table>
  168.  
  169. <!-- <br><a href="<%=JSPRes.path%>/main/customers/acedit.jsp?key=edit&forward=customer-list.jsp">Edit My Profile</a> -->
  170. <!-- FOOTER -->
  171. <jsp:include page="footer.jsp" flush="true"/>
  172.